package com.yue.pattern.singleton;

/**
 * 内部类模式：拥有SimpleSingleton的优点， 同时又有lazy loading
 * Created by qiuyang on 06/04/2017.
 */
public class InnerClassSingleton {
    private InnerClassSingleton(){}

    private InnerClassSingleton getInstance(){
        return InnerClassSingletonHolder.SINGLETON_INSTANCE;
    }

    private static class InnerClassSingletonHolder{
        private static final InnerClassSingleton SINGLETON_INSTANCE = new InnerClassSingleton();
    }
}
